home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Windows
/
WindowLocation.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
833b
|
38 lines
// WindowLocation.cp
#ifndef WindowLocation_h
#include "WindowLocation.h"
#endif
WindowLocation::WindowLocation( Rectangle available, PointObject reasonableSize )
: finished( 0 )
{
PointObject availableSize = available.Size();
if ( reasonableSize.h > availableSize.h )
reasonableSize.h = availableSize.h;
if ( reasonableSize.v > availableSize.v )
reasonableSize.v = availableSize.v;
stop.v = available.bottom - reasonableSize.v;
stop.h = available.left;
location = available.TopLeft();
location.h += 12;
if ( location.h + reasonableSize.h > available.right )
location.h = available.right - reasonableSize.h;
}
void WindowLocation::operator++()
{
Assert( Unfinished() );
location += PointObject( -4, 16 );
if ( location.h < stop.h )
location.h = stop.h;
finished = location.v > stop.v;
}